home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / Media / bumpshader.vsh < prev    next >
Encoding:
Text File  |  2001-10-08  |  735 b   |  51 lines

  1. vs.1.0
  2.  
  3. ;Constants 
  4. ;
  5. ;c0-c3 Object
  6. ;
  7. ;c4-c7 Projection
  8. ;
  9. ;c8-c11 Total matrix
  10. ;
  11. ;c12 - Light Direction (In World Space)
  12. ;
  13. ;Input
  14. ;
  15. ;V0 - Position
  16. ;V7 - Texture 
  17. ;V3 - Normal
  18. ;V8 - Tangnet
  19.  
  20. ;Take normal and binormal into texture space first
  21. m3x3 r7,v8,c0
  22. m3x3 r8,v3,c0
  23.  
  24. ;Cross product orientation flip
  25. ;is content dependent
  26. mul r0,r7.zxyw,-r8.yzxw;
  27. mad r5,r7.yzxw,-r8.zxyw,-r0;
  28.  
  29. ;transform the light vector
  30. dp3 r6.x,r7,c12
  31. dp3 r6.y,r5,c12
  32. dp3 r6.z,r8,c12
  33.  
  34. mov oD0.xyzw,-r6.z;
  35.  
  36. ;this is also our texture coordinate
  37. ;on our basis
  38. mul oT1.xyz,-r6.xyz,c33
  39. ;mov the z value into all teh values of the color
  40.  
  41. ;mov oT1,c33
  42.  
  43. ;transform into projection space
  44. m4x4 oPos,v0,c8
  45. mov oT0.xy,v7
  46.  
  47.  
  48.  
  49.  
  50.  
  51.